/**
 * In me the tiger sniffs the rose.
 *
 * @Author:徐家政
 * @Date:2019-04-01 22:40
 */
package com.shiyu.demo.config;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

@Configuration
public class DruidConfig {
    @Bean(name = "druidDatasource")
    //加载配置文件中以spring.datasource开头的配置

    //test

    //测试分支提交
    @ConfigurationProperties(value ="spring.datasource" )
    public DataSource dataSource(){
        System.out.println("------>init dataSource!");
        DruidDataSource druidDataSource=new DruidDataSource();


        return druidDataSource;
    }
}
